for...of...loop and NodeLists

67

const elements = document.querySelectorAll('.foo');

for (const element of elements) {
    element.addEventListener('click', doSomething);
}

Comments

Submit
0 Comments